package com.woniu.outlet.elasticSearch;

import com.woniu.outlet.elasticSearch.po.Fund;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description:
 * @author: my
 * @time: 2021/4/20 15:12
 */
@Repository
public interface FundESDao extends ElasticsearchRepository<Fund,String> {
    /**
     * 根据类型获取
     * @param fundType
     * @return
     */
    List<Fund> getAllByFundTypeEquals(String fundType, Pageable pageable);

    @Query("{ \"match\" : { \"name\" : \"?0\" }}")
    List<Fund> searchByName(String name);
}
